//package com.why.cachecloud.schedule.jobs;
//
//import com.why.cachecloud.service.inspect.impl.InstanceStateInspector;
//import org.quartz.JobExecutionContext;
//import org.quartz.SchedulerContext;
//import org.quartz.SchedulerException;
//import org.springframework.context.ApplicationContext;
//
///**
// * Created by why.developer on 2020/5/27.
// */
//public class InstanceStatJob extends CacheBaseJob{
//    @Override
//    public void action(JobExecutionContext context) {
//
//        try {
//            long startTime = System.currentTimeMillis();
//            SchedulerContext schedulerContext = context.getScheduler().getContext();
//            ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get(APPLICATION_CONTEXT_KEY);
//
//            InstanceStateInspector instanceStateInspector = applicationContext.getBean(InstanceStateInspector.class);
//            instanceStateInspector.inspect();
//            logger.info("InstanceAlertValueJob cost time {} ms", (System.currentTimeMillis() - startTime));
//        } catch (SchedulerException e) {
//            logger.error(e.getMessage(), e);
//        }
//    }
//}
